﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Demos.util;
using mendian;
using Luna小店.DTO;
using Luna小店.UC.面料库存.库存记录.service;
using Luna小店.UC.面料库存.盘点.service;

namespace Luna小店.UC.面料库存
{
    public partial class Form盘盈入库 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        private List<DTO采购分录> DTO采购分录s = new List<DTO采购分录>();
        public Form盘盈入库()
        {
            InitializeComponent();
        }

        private void barButtonItem提交_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DTO盘盈入库 DTO盘盈入库 = new DTO盘盈入库(
                "盘盈入库",
                this.dateTimePicker日期.Value,
                this.DTO采购分录s
                );
            //webservice传值
            盘点Service.post盘盈入库(DTO盘盈入库);
            MessageBox.Show("盘盈入库成功");
        }

        private void barButtonItem新增分录_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Frm盘盈入库分录 frm = new Frm盘盈入库分录();
            frm.ShowDialog();
            if (null == frm.DTO采购分录)
            {
                return;
            }
            this.DTO采购分录s.Add(frm.DTO采购分录);
            this.gridControl采购分录.DataSource = this.DTO采购分录s;
            this.gridView采购分录.RefreshData();
        }
    }

    
}